package ast;

import out.Out;
import mem.interfaces.IMem;
import environnement.interfaces.IEnv;
import exceptions.LogoException;
import ast.interfaces.IAST;
import ast.interfaces.IASTnot;

public class ASTnot implements IASTnot {
	private IAST op1;
	
	public ASTnot(IAST op1){
		this.op1 = op1;
	}
	
	@Override
	public Boolean eval(Out o, IEnv e, IMem m) throws LogoException{
		return (Boolean) getOp1().eval(o, e, m);
	}

	@Override
	public String toTreeString(String ident, IEnv e, IMem m) {
		return ident + " not " + getOp1().toTreeString(ident, e, m);
	}

	public IAST getOp1() {
		return op1;
	}

	public void setOp1(IAST op1) {
		this.op1 = op1;
	}

}
